#!/usr/bin/env perl
#
BEGIN {
	unshift @::INC,"/opt/linuxha14/lib/perl";
}

use strict;
use warnings;
use Data::Dumper;

use drbd84;

$::a1=new drbd84();


# {
	# my ($a,$b)=$::a1->populate(file => "/etc/drbd.d/apache_apachevg_lvol1.res");
	# if(!$a) {
		# print STDERR "Error: $b\n";exit 1;
	# }
	# print Dumper($::a1);
	# exit(0);
# }

{
	my ($a,$b)=$::a1->set_application_storage(device => '/dev/drbd0', application => 'apache',vg => 'apachevg',lvol => 'lvol1');
	if(!$a) {
		print STDERR "Error: $b\n";exit 1;
	}
}

{
my ($a,$b)=$::a1->set_ips(host1_name => 'sl61-1',host1_ip => 'fec1::192:168:100:140',host1_port => 9901,
			  host2_name => 'sl61-2',host2_ip => 'fec1::192:168:100:141',host2_port => 9901);
	if(!$a) {
		print STDERR "Error: $b\n";exit 1;
	}
}

{
my ($a,$b)=$::a1->write_file();
	if(!$a) {
		print STDERR "Error: $b\n";exit 1;
	}
}
exit(0);
